import Vue from 'vue'
import Router from 'vue-router'
// import login from '@/page/login/login'
// import home from '@/page/home/home'
import layout from '@/page/layout/layout'
// import HelloWorld from '@/components/HelloWorld'

Vue.use(Router)
// 默认路由表，不需要权限
const routes = [{
  path: '/',
  // redirect: '/home'
  component: r => require.ensure([], () => r(require('../page/home/home')), 'home')
},
{
  path: '/login',
  // component: login
  component: r => require.ensure([], () => r(require('../page/login/login')), 'login')
},
{
  path: '/layout',
  component: layout,
  children: [
    {
      path: '0-0',
      component : r => require.ensure([], () => r(require('../components/platformCom/tablePage')), 'table')
    },
    {
      path: '0-1',
      component :r => require.ensure([], () => r(require('../components/platformCom/echartPage')), 'echart')
    }
  ]
  // component: r => require.ensure([], () => r(require('../page/login/login')), 'login')
},
{
  path: '/defaultLayout',
  component: r => require.ensure([], () => r(require('../page/layout/layout')), 'layout'),
  meta:{
    permission:[]
  },
  // 需要进行用户登录验证
  children: [{
    path: '/home',
    component: r => require.ensure([], () => r(require('../page/home/home')), 'home'),
  }]
},
]

export default new Router({
  routes
})
